package c.e.a.b.f.b;

import android.os.RemoteException;
import c.e.a.b.e.c.hc;
import c.e.a.b.e.c.v8;
import com.google.android.gms.measurement.internal.zzn;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class u7 implements Runnable {
    public final /* synthetic */ zzn a;
    public final /* synthetic */ hc b;
    public final /* synthetic */ q7 c;

    public u7(q7 q7Var, zzn zzn, hc hcVar) {
        this.c = q7Var;
        this.a = zzn;
        this.b = hcVar;
    }

    public final void run() {
        String str = "Failed to get app instance id";
        try {
            if (v8.a() && this.c.a.g.o(p.H0) && !this.c.l().y().k()) {
                this.c.d().k.a("Analytics storage consent denied; will not get app instance id");
                this.c.n().g.set(null);
                this.c.l().l.b(null);
                return;
            }
            q7 q7Var = this.c;
            i3 i3Var = q7Var.d;
            if (i3Var == null) {
                q7Var.d().f.a(str);
                this.c.k().M(this.b, null);
                return;
            }
            String u0 = i3Var.u0(this.a);
            if (u0 != null) {
                this.c.n().g.set(u0);
                this.c.l().l.b(u0);
            }
            this.c.F();
            this.c.k().M(this.b, u0);
        } catch (RemoteException e) {
            this.c.d().f.b(str, e);
        } finally {
            this.c.k().M(this.b, null);
        }
    }
}
